
<script>
/**
 * 使用插槽实现switch功能
 */
export default {
  name: 'HSwitch',
  props: ['case'],
  setup: (props, { slots }) =>
    () => {
      if (slots[props.case]) {
        return slots[props.case]({ name: props.case })
      }
      return slots['default']()
    }

}

</script>
